FROM myharbor.com/bigdata/centos:7.9.2009
RUN rm -f /etc/localtime && ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
RUN export LANG=zh_CN.UTF-8

### install tools
RUN yum install -y vim tar wget curl less telnet net-tools lsof mysql

RUN mkdir -p /opt/apache

### JDK
ADD jdk-8u212-linux-x64.tar.gz  /opt/apache/
ENV JAVA_HOME /opt/apache/jdk1.8.0_212
ENV PATH $JAVA_HOME/bin:$PATH

### Azkaban
RUN mkdir /opt/apache/azkaban
ENV AZKABAN_HOME /opt/apache/azkaban
ADD azkaban-exec-server.tar.gz $AZKABAN_HOME
ADD azkaban-web-server.tar.gz $AZKABAN_HOME
ADD azkaban-db.tar.gz $AZKABAN_HOME
COPY init.sql $AZKABAN_HOME/azkaban-db/

COPY docker-entrypoint.sh /opt/apache
COPY deleteExec.sh /opt/apache
RUN chmod +x /opt/apache/docker-entrypoint.sh
RUN chmod +x /opt/apache/deleteExec.sh

RUN groupadd --system --gid=9999 admin && useradd --system --home-dir /opt/home --uid=9999 --gid=admin admin

RUN chown -R admin:admin /opt/apache

#设置的工作目录
WORKDIR $AZKABAN_HOME

# 执行脚本，构建镜像时不执行，运行实例才会执行
ENTRYPOINT ["/opt/apache/docker-entrypoint.sh"]
